//
//  CWQ_personInfoVC.m
//  BaxTer
//
//  Created by 陈武琦 on 16/9/6.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "CWQ_personInfoVC.h"
#import "CWQ_titleContentCell.h"
#import "Masonry.h"
static NSString * const cellId = @"CWQ_titleContentCellID";
@interface CWQ_personInfoVC ()

@end

@implementation CWQ_personInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"个人信息";
    [self.tableView registerNib:[UINib nibWithNibName:@"CWQ_titleContentCell" bundle:nil] forCellReuseIdentifier:cellId];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).with.offset(0);
        make.right.equalTo(self.view).with.offset(0);
        make.top.equalTo(self.view).with.offset(0);
        make.bottom.equalTo(self.view).with.offset(0);
    }];

}
#pragma mark ----------------tableview代理--------------------------


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 5;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    CWQ_titleContentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath];
    //设置cell 的分割线
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
    //    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    BTUserInfoM *userInfo = [HELAppManager userInfo];
    switch (indexPath.row) {
        case 0:
            cell.title.text = @"工号";
            cell.content.text = userInfo.baxterid;
            break;
        case 1:
            cell.title.text = @"姓名";
            cell.content.text = userInfo.acname;
            break;
            
        case 2:
            cell.title.text = @"部门";
            cell.content.text = userInfo.departname;
            break;
        case 3:
            cell.title.text = @"职位";
            cell.content.text = userInfo.employeeTypeName;
            break;
        case 4:
            cell.title.text = @"邮箱";
            cell.content.text = userInfo.busnEmailAddr;
            break;
            
        default:
            break;
    }
    return cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 44;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
   
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
